/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vv;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import parsing.ParseException;
import parsing.Parser;
import syntax.TIOA;
import test.MinDelayTestStrategy;
import test.TestStrategy;

/**
 *
 * @author hicham
 */
public class Test {

    TIOA tioa;
    Parser parser;
    File file;
    FileReader fi;

    public Test() {
        file = new File("C:\\Users\\ennouaary\\Documents\\NetBeansProjects\\TIOA\\examples\\tel.txt");
        try {
            fi = new FileReader(file);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
        }
        parser = new Parser(fi);
        try {
            tioa = parser.getTIOA();
        } catch (ParseException ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static void main(String args[]) {
        System.out.println("OK");
        Test test = new Test();
        test.tioa.printTIOA();
        TestStrategy testStrategy = new MinDelayTestStrategy();
        System.out.println(testStrategy.test(test.tioa));
    }
}
